<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" th:href="@{/css/pintuer.css}">
    <link rel="stylesheet" th:href="@{/css/admin.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/jquery.datetimepicker.css}"/>
    <script th:src="@{/js/jquery.js}"></script>
    <script th:src="@{/js/pintuer.js}"></script>
    <script th:src="@{/js/jquery.datetimepicker.js}" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="panel admin-panel margin-top">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>添加内容</strong></div>
    <div class="body-content">
        <form th:action="@{/fileManage/upload}" method="post" class="form-x" enctype="multipart/form-data">
            <div class="form-group">
                <div class="label">
                    <label>所属文件夹：</label>
                </div>
                <div class="field">
                    <select name="folderValue" class="input w80" style="line-height:17px;" onchange="changesearch()">
                        <option th:each="folder:${folderList}" th:value="${folder.tid}+'-'+${folder.tname}" th:text="${folder.tname}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>选择文件：</label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" id="addFile" type="button"> 添加一行</button>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                </div>
                <div class="field" id="myfile">
<!--                    <div><a class="button input-file bg-green" href="javascript:void(0);">+ 浏览文件<input-->
<!--                                                                                                       type="file"-->
<!--                                                                                                       name="uploadFile"/></a>-->
<!--                        <a class="button input-file bg-red" href="javascript:void(0);" onclick="del(this)"> 删除</a>-->
<!--                    </div>-->
                    <div><input type="file" name="uploadFile"></div>

                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
                </div>
            </div>
        </form>

    </div>
</div>
<script type="text/javascript">
    $('#hiredate').datetimepicker({
        format: "Y-m-d h:i",
        lang: 'kr',
        step: 1
    });

    $("#addFile").click(function () {
        // var html = '<div><a class="button input-file bg-green" href="javascript:void(0);">+ 浏览文件<input size="100" type="file" name="uploadFile" /></a> <a class="button input-file bg-red" onclick="del(this)"> 删除</a><div>'
        var html='<div><input type="file" name="uploadFile"></div>'
        $("#myfile").append(html);
    });

    function del(obj) {
        obj.parentElement.remove();
    }
</script>
</body>
</html>